<template>
  <el-dialog :visible.sync="dialogFormVisible" width="900px" @close="close">
    <template slot="title">
      <div>
        <svg-icon icon-class="program-info" />
        <span>{{ title }}</span>
      </div>
    </template>
    <el-form
      :inline="true"
      :model="currentProgram"
      class="demo-form-inline"
      label-width="30%"
    >
      <el-divider>
        <span style="color: #b5b4b4">编码信息</span>
      </el-divider>
      <el-form-item
        :label="tempDesc.organization"
        prop="organization"
        class="formItem normalInput"
      >
        <el-input v-model="currentProgram.organization" disabled></el-input>
      </el-form-item>
      <el-form-item
        :label="tempDesc.modelNum"
        prop="modelNum"
        class="formItem normalInput"
      >
        <el-input v-model="currentProgram.modelNum" disabled></el-input>
      </el-form-item>
      <el-form-item
        :label="tempDesc.speciality"
        prop="speciality"
        class="formItem normalInput"
      >
        <el-input v-model="currentProgram.speciality" disabled></el-input>
      </el-form-item>
      <el-form-item
        :label="tempDesc.modelNumPart"
        prop="modelNumPart"
        class="formItem normalInput"
      >
        <el-input v-model="currentProgram.modelNumPart" disabled></el-input>
      </el-form-item>
      <el-form-item
        :label="tempDesc.versionNum"
        prop="versionNum"
        class="formItem normalInput"
      >
        <el-input v-model="currentProgram.versionNum" disabled></el-input>
      </el-form-item>
      <el-form-item
        :label="tempDesc.freeNum"
        prop="freeNum"
        class="formItem normalInput"
      >
        <el-input v-model="currentProgram.freeNum" disabled></el-input>
      </el-form-item>
      <el-divider><span style="color: #b5b4b4">基本信息</span></el-divider>
      <el-form-item
        :label="tempDesc.preId"
        label-width="14%"
        prop="preId"
        class="longInput"
      >
        <el-input v-model="currentProgram.preId" disabled></el-input>
      </el-form-item>
      <el-form-item
        :label="tempDesc.name"
        prop="name"
        class="formItem normalInput"
      >
        <el-input v-model="currentProgram.name" disabled></el-input>
      </el-form-item>
      <el-form-item
        :label="tempDesc.hostIp"
        prop="hostIp"
        class="formItem normalInput"
      >
        <el-input v-model="currentProgram.hostIp" disabled></el-input>
      </el-form-item>
      <el-form-item
        :label="tempDesc.installationDir"
        prop="installationDir"
        class="formItem normalInput"
      >
        <el-input v-model="currentProgram.installationDir" disabled></el-input>
      </el-form-item>
      <el-form-item
        :label="tempDesc.description"
        prop="description"
        class="formItem normalInput"
      >
        <el-input v-model="currentProgram.description" disabled></el-input>
      </el-form-item>
      <el-form-item
        :label="tempDesc.createTime"
        prop="installationDir"
        class="formItem normalInput"
      >
        <el-input v-model="currentProgram.createTime" disabled></el-input>
      </el-form-item>
      <el-form-item
        :label="tempDesc.status"
        prop="description"
        class="formItem normalInput"
      >
        <el-input v-model="currentProgram.status" disabled></el-input>
      </el-form-item>
      <el-form-item
        :label="tempDesc.shell"
        prop="shell"
        class="formItem normalInput"
      >
        <!-- 有问题！ -->
        <el-input v-model="currentProgram.shell" disabled></el-input>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="close">关 闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
  // 常量title
  const tempDesc = {
    id: '',
    preId: '程序编号',
    name: '程序名称',
    status: '状态',
    hostIp: '主机ip',
    installationDir: '安装地址',
    description: '描述',
    createTime: '创建时间',
    dataType: '数据类型',
    organization: '组织',
    modelNum: '型号',
    speciality: '专业',
    modelNumPart: '部件',
    versionNum: '版本编号',
    freeNum: '自由编号',
    createrPreId: '创建人',
    createTime6: '创建时间',
    specialityName: '专业名称',
    organizationName: '组织名称',
    shell: 'shell调用',
  }
  export default {
    name: 'ProgramDetailedInfo',
    data() {
      return {
        tempDesc: tempDesc,
        title: '',
        dialogFormVisible: false,
        currentProgram: {},
      }
    },
    methods: {
      showEdit(row) {
        this.title = '程序编号：' + row.preId
        this.currentProgram = row
        this.dialogFormVisible = true
      },
      close() {
        this.dialogFormVisible = false
      },
    },
  }
</script>
<style lang="scss">
  .formItem {
    width: 45%;
  }
  .normalInput .el-form-item__content {
    width: 70%;
    margin: 0px;
  }
  .el-form-item {
    margin-right: 0px;
  }
  .longInput {
    width: 100%;
  }
  .longInput .el-form-item__content {
    width: 77%;
  }
  .el-select {
    width: 100%;
    margin: 0px;
  }
</style>
